import http from "@/utils/http";
// 微信登录
export const wxLogin = (data) => {
  return http.post("/pub/login/wx", data);
};
//获取用户信息
export const getUserInfo = () => {
  return http.get("/auth/user/userHome");
};
//修改用户信息
export const updateUserInfo = (data) => {
  return http.put("/auth/user/user", data);
};
//获取用户优惠券
export const getCouponList = (params) => {
  return http.get("/auth/user/coupon/list", params);
};
//获取用户地址列表
export const getAddressList = () => {
  return http.get("/auth/user/address/list");
};
//新增用户地址
export const addAddress = (data) => {
  return http.post("/auth/user/address", data);
};
//获取地址详情
export const getAddressDetail = (id) => {
  return http.get(`/auth/user/address/${id}`);
};
//修改地址
export const updateAddress = (data) => {
  return http.put("/auth/user/address", data);
};
//删除地址
export const deleteAddress = (id) => {
  return http.delete(`/auth/user/address/${id}`);
};
//获取收藏列表
export const getCollectList = (params) => {
  return http.get("/auth/user/user/goods/collect/list", params);
};
// 兑换码
export const exchangeCode = (data) => {
  return http.get("/auth/cdk/getSdKey", data);
};
// 兑换记录
export const exchangeRecord = (params) => {
  return http.get("/auth/cdk/getLog", params);
};
